package com.cy.service;

import com.cy.dao.IGoodsDao;
import com.cy.domain.Goods;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class GoodsService implements IGoodsService{
    /**
     * 日志生成
     */
    private static final Logger log = LoggerFactory.getLogger(GoodsService.class);
    @Autowired
    @Qualifier("goodsDao")
    private IGoodsDao iGoodsDao;

    @Override
    public List<Goods> findGoods() {

        long oldTime = System.currentTimeMillis();
        List<Goods> list = iGoodsDao.findObjects();
        long newTime = System.currentTimeMillis();
        log.info("newTime - oldTime = {}",newTime - oldTime);
        return list;
    }
}
